/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.yuhanginfo.modules.sys.entity;

import java.util.Date;

import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.yuhanginfo.common.persistence.DataEntity;
import com.yuhanginfo.common.utils.excel.annotation.ExcelField;

/**
 * 登录日志Entity
 * @author lvls
 * @version 2017-09-27
 */
public class LoginInfo extends DataEntity<LoginInfo> {
	
	private static final long serialVersionUID = 1L;
	private String loginName;		// 登录用户名
	private String loginIp;		// 登录ip
	private String browserName;		// 浏览器
	private String equipment;		// 设备
	private Date createTime;		// 创建时间
	private String createUser;		// 创建者
	private Date updateTime;		// 更新时间
	private String updateUser;		// 更新者
	private Integer userType;
	private String company;
	private Date startTime;
	private Date endTime;
	
	public LoginInfo() {
		super();
	}

	public LoginInfo(String id){
		super(id);
	}
	@ExcelField(title="用户名", align=2, sort=10)  
	@Length(min=0, max=64, message="login_name长度必须介于 0 和 64 之间")
	public String getLoginName() {
		return loginName;
	}

	public void setLoginName(String loginName) {
		this.loginName = loginName;
	}
	
	@Length(min=0, max=16, message="login_ip长度必须介于 0 和 16 之间")
	@ExcelField(title="登录IP", align=2, sort=40)  
	public String getLoginIp() {
		return loginIp;
	}

	public void setLoginIp(String loginIp) {
		this.loginIp = loginIp;
	}
	
	@Length(min=0, max=50, message="browser_name长度必须介于 0 和 50 之间")
	@ExcelField(title="登录浏览器", align=2, sort=70) 
	public String getBrowserName() {
		return browserName;
	}

	public void setBrowserName(String browserName) {
		this.browserName = browserName;
	}
	
	@Length(min=0, max=50, message="equipment长度必须介于 0 和 50 之间")
	@ExcelField(title="登录设备", align=2, sort=50)  
	public String getEquipment() {
		return equipment;
	}

	public void setEquipment(String equipment) {
		this.equipment = equipment;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@NotNull(message="创建时间不能为空")
	@ExcelField(title="登录时间", align=2, sort=60)  
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	
	@Length(min=0, max=50, message="创建者长度必须介于 0 和 50 之间")
	public String getCreateUser() {
		return createUser;
	}

	public void setCreateUser(String createUser) {
		this.createUser = createUser;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@NotNull(message="更新时间不能为空")
	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}
	
	@Length(min=0, max=50, message="更新者长度必须介于 0 和 50 之间")
	public String getUpdateUser() {
		return updateUser;
	}

	public void setUpdateUser(String updateUser) {
		this.updateUser = updateUser;
	}
	
	@ExcelField(title="用户类型", align=2, sort=10 ,dictType="user_type")  
	public Integer getUserType() {
		return userType;
	}

	public void setUserType(Integer userType) {
		this.userType = userType;
	}
	
	@ExcelField(title="企业名称", align=2, sort=30)  
	public String getCompany() {
		return company;
	}

	public void setCompany(String company) {
		this.company = company;
	}

	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}
	
}